{config_load file="config.conf" section="setup"}
{include file="header.tpl"}
{include file="header_body.tpl"}

<!-- START CONTENT -->
<section class="container clearfix">
    <!-- START PAGE INFO -->
    <header class="container page_info clearfix">

        <h1 class="regular brown bottom_line">Logowanie</h1>

        <div class="clear"></div>
    </header>

    <!-- END PAGE INFO -->

    <div class="padding15"></div>

    <div>
        {if $isSignedIn}
            <p>'You are already signed in, you can <a href="signout.php">sign out</a> if you want.'</p>
        {else}
            {if $displayLogPanel}
            <form action="signin.php" method="post" class="contact_form">
                <p>
                    <label for="user_name">Login </label>
                    <input class="inputText" type="text" name="user_name" />
                </p>
                <div class="clear"></div>
                <p>
                    <label for="user_name">Hasło </label>
                    <input class="inputText" type="password"  name="user_pass" />
                </p>
                <div class="clear"></div>
                <p class="submit">
                <input type="submit" value="Zaloguj" />
                </p>
                </form>
            {else}
                {if isset($errors)}
                    <!-- ERROR MESSAGE -->
                    <div class="error_box">
                        Uzupełnij wymagane pola.
                    </div>
                    <!-- END ERROR MESSAGE -->

                    <ul>
                        {foreach from=$errors key=k item=v}
                            <li>{$k}: {$v}</li>
                        {/foreach}
                    </ul>
                {else}
                    {if $result==false}
                        <div class="error_box">
                            Wystąpił błąd. Spróbuj później!
                        </div>
                    {else}
                        {if $wrongId}
                            <div class="error_box">
                                Błędny login bądź hasło. <a href="signin.php">Spróbuj ponownie.</a>
                            </div>
                        {else}
                            <div class="success_box">
                                Witaj, {$user_name} . <br /><a href="index.php">Przejdź do strony glownej</a>
                            </div>
                        {/if}
                    {/if}

                {/if}
            {/if}

        {/if}
    </div>
    <!-- END COL 2/3 LAST -->



    <div class="clear padding20"></div>


</section>
<!-- END CONTENT -->

{include file="footer.tpl"}